The current code uses the arrow alignment to align the menu between
the top/left (0) and bottom/right(1), regardless of the text direction.
Instead of adjusting code everywhere, reinterpret the parameter
to refer to start/end instead, and swap the alignment with an
RTL text direction.
Credit to Sebastian Keller for spotting the cause of the issue.
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5261
Close https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7356
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3150>
switch (this._arrowSide) {
case St.Side.TOP:
case St.Side.BOTTOM:
+ if (this.text_direction === Clutter.TextDirection.RTL)
+ alignment = 1.0 - alignment;
+
resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment);
resX = Math.max(resX, workarea.x + padding);